function selfDesign_studentRegister($table, $salt1, $salt2, $name, $studentID, $passwd, $email)
{
	$query = "CREATE TABLE IF NOT EXISTS $table(" .
			 "name VARCHAR(32) not null, $studentID CHAR(10) not null primary key, " .
			 "passwd CHAR(32) not null, email VARCHAR(256) not null, " .
			 "INDEX(name(6)), INDEX(studentID(6)), " .
			 "INDEX(email(6))";
	mysql_query($query) or die(mysql_error());
	
	$query = "SELECT * FROM $TABLE WHERE studentID='$studentID'";
	/*return -2 if the studentID already exists in db*/
	if(mysql_num_rows(mysql_query($query)) == 1) return -2;
	
	$pass = md5($salt1 . $passwd . $salt2);
	$query = "INSERT INTO $table VALUES('$name', '$studentID', '$passwd', '$email')";
	/* return 1 if the insert is successful*/
	if (mysql_query($query)) return 1; 
	/* return -1 if the insert is failed */
	else return -1;
	
	

}
